package com.yckj.day02;

/**
 * TODO 自加自减运算符
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/17 11:11
 */
public class Demo3 {
    public static void main(String[] args) {
        int a = 3;
        // 先取值，后自加
        int b = a++; // a = a + 1;
        System.out.println(a+","+b);
        // 先自加，再取值赋值
        int c = ++a;
        System.out.println(a+","+c);
        int a1 = 4;
        int b1 = ++a1;
        int c1 = b1++ + --a1 - --b1 + ++b1;
        System.out.println(a1+","+b1+","+c1);

    }
}
